package xg2013.totoro.domain;

import java.io.Serializable;
import java.util.Calendar;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
@Entity
@Table(name = "validity")
public class Validity implements Serializable{
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;

    private Calendar beginTime;

    private Calendar endTime;
    @OneToOne(mappedBy = "validity",cascade = CascadeType.ALL)
    private Major major;
    @ManyToOne
    @JoinColumn(name = "resource_id")
    private Resource resource;
	
    public Integer getId(){
        return this.id;
    }

    public void setId(Integer id){
        this.id = id;
    }
		
    public Calendar getBeginTime(){
        return this.beginTime;
    }

    public void setBeginTime(Calendar beginTime){
        this.beginTime = beginTime;
    }
		
    public Calendar getEndTime(){
        return this.endTime;
    }

    public void setEndTime(Calendar endTime){
        this.endTime = endTime;
    }

	public Major getMajor() {
		return major;
	}

	public void setMajor(Major major) {
		this.major = major;
	}

	public Resource getResource() {
		return resource;
	}

	public void setResource(Resource resource) {
		this.resource = resource;
	}
	
}